home *** CD-ROM | disk | FTP | other *** search
- /*
- HyperXCmd.h Definitions for calling all standard
- HyperCard callback routines from C.
- ©Apple Computer, Inc. 1987
- All Rights Reserved.
-
- See CFlash.C for an example of how to include this module in your
- C program.
- */
-
- #include <MacTypes.h>
-
- typedef struct XCmdBlock {
- short paramCount;
- Handle params[16];
- Handle returnValue;
- Boolean passFlag;
-
- void (*entryPoint)(); /* to call back to HyperCard */
- short request;
- short result;
- long inArgs[8];
- long outArgs[4];
- } XCmdBlock, *XCmdBlockPtr;
-
- typedef unsigned char Str31[32];
- /*
- typedef struct Str31 {
- char guts[32];
- } Str31, *Str31Ptr;
- */
-
- enum {
- xresSucc = 0,
- xresFail,
- xresNotImp
- };
-
- /* request codes */
- enum {
- xreqSendCardMessage = 1,
- xreqEvalExpr,
- xreqStringLength,
- xreqStringMatch,
- xreqSendHCMessage,
- xreqZeroBytes,
- xreqPasToZero,
- xreqZeroToPas,
- xreqStrToLong,
- xreqStrToNum,
- xreqStrToBool,
- xreqStrToExt,
- xreqLongToStr,
- xreqNumToStr,
- xreqNumToHex,
- xreqBoolToStr,
- xreqExtToStr,
- xreqGetGlobal,
- xreqSetGlobal,
- xreqGetFieldByName,
- xreqGetFieldByNum,
- xreqGetFieldByID,
- xreqSetFieldByName,
- xreqSetFieldByNum,
- xreqSetFieldByID,
- xreqStringEqual,
- xreqReturnToPas,
- xreqScanToReturn,
- xreqScanToZero = 39 /* was suppose to be 29! Oops! */
- };
-
-
- /* Forward definitions of glue routines. Main program
- must include XCmdGlue.inc.c. See XCmdGlue.inc.c for
- documentation of each routine. */
-
- typedef void (*MyProcPtr) ();
-
- pascal void SendCardMessage(XCmdBlockPtr, StringPtr msg);
- pascal Handle EvalExpr(XCmdBlockPtr, StringPtr expr);
- pascal long StringLength(XCmdBlockPtr, StringPtr strPtr);
- pascal Ptr StringMatch(XCmdBlockPtr, StringPtr pattern, Ptr target);
- pascal void ZeroBytes(XCmdBlockPtr ,Ptr dstPtr, long longCount);
- pascal Handle PasToZero(XCmdBlockPtr, StringPtr pasStr);
- pascal void ZeroToPas(XCmdBlockPtr, unsigned char *zeroStr, StringPtr pasStr);
- pascal long StrToLong(XCmdBlockPtr, unsigned char * strPtr);
- pascal long StrToNum(XCmdBlockPtr, unsigned char *str);
- pascal Boolean StrToBool(XCmdBlockPtr,unsigned char *str);
- pascal void StrToExt(XCmdBlockPtr,unsigned char *str, double *myext);
- pascal void LongToStr(XCmdBlockPtr, long posNum, unsigned char *mystr);
- pascal void NumToStr(XCmdBlockPtr, long num, unsigned char *mystr);
- pascal void NumToHex(XCmdBlockPtr, long num, short nDigits, unsigned char *mystr);
- pascal void BoolToStr(XCmdBlockPtr, Boolean bool, unsigned char *mystr);
- pascal void ExtToStr(XCmdBlockPtr, double *myext, unsigned char *mystr);
- pascal Handle GetGlobal(XCmdBlockPtr, StringPtr globName);
- pascal void SetGlobal(XCmdBlockPtr, StringPtr globName, Handle globValue);
- pascal Handle GetFieldByName(XCmdBlockPtr, Boolean cardFieldFlag, StringPtr fieldName);
- pascal Handle GetFieldByNum(XCmdBlockPtr, Boolean cardFieldFlag, short fieldNum);
- pascal Handle GetFieldByID(XCmdBlockPtr,Boolean cardFieldFlag, short fieldID);
- pascal void SetFieldByName(XCmdBlockPtr, Boolean cardFieldFlag, StringPtr fieldName, Handle fieldVal);
- pascal void SetFieldByNum(XCmdBlockPtr, Boolean cardFieldFlag, short fieldNum,Handle fieldVal);
- pascal void SetFieldByID(XCmdBlockPtr, Boolean cardFieldFlag, short fieldID,Handle fieldVal);
- pascal Boolean StringEqual(XCmdBlockPtr, unsigned char *str1, unsigned char *str2);
- pascal void ReturnToPas(XCmdBlockPtr, Ptr zeroStr, StringPtr pasStr);
- pascal void ScanToReturn(XCmdBlockPtr, Ptr *scanHndl);
- pascal void ScanToZero(XCmdBlockPtr, Ptr *scanHndl);
-